/**
 * Classname :SearchResult.java
 *
 * Version information: 1.0
 *
 * Date: 20140315
 *
 */
package com.astrocsr.domain.db;

import java.util.ArrayList;
import java.util.List;

public class SearchResult<T> extends ArrayList<T> implements List<T> {

    private static final long serialVersionUID = 673604787850790724L;

    private PagingInfo pagingInfo;

    /**
	 * @return the pagingInfo
	 */
	public PagingInfo getPagingInfo() {
		return pagingInfo;
	}

	/**
	 * @param pagingInfo the pagingInfo to set
	 */
	public void setPagingInfo(PagingInfo pagingInfo) {
		this.pagingInfo = pagingInfo;
	}

	/**
     * 
     * @param result
     */
    public void setResult(List<T> result) {
    	if(result != null && result.size() > 0) {
    		this.addAll(result);
    	}
    }
    
    /*
     * (non-Javadoc)
     * @see java.util.AbstractCollection#toString()
     */
    public String toString() {
        return "SearchResult-[pagingInfo:" + pagingInfo + ", result size:" + this.size() + "]";
    }
}
